﻿<UserControl x:Class="Agnes.Mainframe.NewSlnView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:csla="clr-namespace:Csla.Xaml;assembly=Csla.Xaml"
             xmlns:res="clr-namespace:Agnes.Core;assembly=Agnes.Core"
             xmlns:local="clr-namespace:Agnes.Mainframe"
             mc:Ignorable="d" 
             FontFamily="Microsoft YaHei"
             d:DesignHeight="800" d:DesignWidth="609" FontSize="14" OverridesDefaultStyle="False" Focusable="True">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Agnes.Mainframe;Component/MainframeResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid Margin="30">
        <Grid.Resources>
            <Style x:Key="LineStyle" TargetType="{x:Type Path}">
                <Setter Property="Margin" Value="0,5,0,0" />
                <Setter Property="StrokeThickness" Value="2" />
                <Setter Property="Fill" Value="Black" />
                <Setter Property="Stroke" Value="LightGray" />
                <Setter Property="Data">
                    <Setter.Value>
                        <LineGeometry StartPoint="0,0" EndPoint="600,0" />
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" FontSize="28" Text="新建 Agnes 解决方案">
            
        </TextBlock>
        <TextBlock Grid.Row="1" FontSize="16" Text="{DynamicResource Mainframe_NewSln_Step1}" Margin="0,30,0,0" MinWidth="200"/>
        <Path Grid.Row="2" Style="{StaticResource LineStyle}"/>
        <StackPanel Grid.Row="3" Margin="0,5,0,0" Orientation="Horizontal">
            <TextBox MaxWidth="300" MinWidth="250" MaxLength="256"
                     Text="{Binding Model.SlnName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  />  
            <csla:PropertyStatus Property="{Binding Model.SlnName}" Margin="5,0,0,0" />
        </StackPanel>
        <TextBlock Grid.Row="4" Margin="0,20,0,0" Text="2.选择位置: " FontSize="16" />
        <Path Grid.Row="5" Style="{StaticResource LineStyle}" />
        <StackPanel Grid.Row="6" Orientation="Horizontal">
            <TextBox HorizontalAlignment="Left" MinWidth="300" Margin="0,5,0,0" Text="{Binding Model.LocatedDir, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            <Button x:Name="Browser" Content="浏览" Margin="10,5,0,0" MinWidth="50" />
            <csla:PropertyStatus Property="{Binding Model.LocatedDir}" Margin="5,5,0,0" />
        </StackPanel>
        <TextBlock Grid.Row="7" Text="3.方案加密  " Margin="0,20,0,0" FontSize="16" />
        <Path Grid.Row="8" Style="{StaticResource LineStyle}" />
        <PasswordBox  x:Name="PwdBox"
                      local:PasswordBoxHelper.IsPasswordBindingEnabled="True"
                      local:PasswordBoxHelper.BindedPassword="{Binding Model.Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                      Grid.Row="9" HorizontalAlignment="Left"
                      PasswordChanged="PasswordBox_PasswordChanged"
                      MinWidth="250" Margin="0,5,0,0"/>
        <Path Grid.Row="10" Style="{StaticResource LineStyle}" Margin="0,50,0,0" />
        <Button x:Name="CreateNewSln" Grid.Row="11" Margin="0,10,0,0" MinWidth="100" MinHeight="100"
                HorizontalAlignment="Right" >
            <Button.Template>
                <ControlTemplate>
                    <Border Style="{StaticResource NormalButtonStyle}" IsEnabled="{Binding ElementName=CreateNewSln, Path=IsEable}" >
                        <Grid >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Image Source="pack://application:,,,/Agnes.Resources;Component/Image/Agnes.Mainframe/NewSln/New.png" Grid.Row="0" Width="80" Height="80" ></Image>
                            <TextBlock Grid.Row="1" Text="创建Agnes方案" Margin="5" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
    </Grid>
</UserControl>
